#pragma once
#include <wx\wx.h>
#include <DEngine.h>
#include <wx/glcanvas.h>

class RenderFrame: wxGLCanvas
{
	bool m_bAllowRender;
	wxGLContext *m_glRC;

public:
	RenderFrame(wxWindow *parent, wxWindowID id = wxID_ANY,
        const wxPoint& pos = wxDefaultPosition,
        const wxSize& size = wxDefaultSize, long style = 0,
        const wxString& name = wxT("RenderFrame"));

	~RenderFrame(void);

	void paintEvent(wxPaintEvent &evt);
	void OnEraseBackground(wxEraseEvent& event);
	void OnSize(wxSizeEvent &event);
	void paintNow();
	void render(wxDC &dc);
	bool InitGLWindow(int bits);
	void CanRender(bool b);
	void OnMouseEvent(wxMouseEvent &evt);
	void OnChar(wxKeyEvent &evt);

	wxDECLARE_NO_COPY_CLASS(RenderFrame);
	DECLARE_EVENT_TABLE()
};

